package top.toptimus.dto.saleStyle;

import lombok.Data;
import lombok.NoArgsConstructor;
import top.toptimus.dto.accessory.StyleAccessoryDTO;

import java.util.List;

/**
 * 样衣信息
 */
@Data
@NoArgsConstructor
public class SaleStyleSampleDTO {
    private String saleInventoryId; //  货号主键
    private Integer inventorySuffix; //  货号后缀   给出货号定义年月
    private Integer refInventorySuffix; //  参考货号后缀
    private String saleStyleId; //  销售款式id  top.toptimus.style.dao.SaleStyleDao.id
    private String saleStyleCode;   //  款号，销售定义 top.toptimus.style.dao.SaleStyleDao.saleStyleCode
    private String saleInventoryMatialId;   //  货号对应物料定义
    private String styleNameCN; //  工艺款式名称
    /**
     * 面料定义
     */
    private Integer materialId; //  物料数据库ID
    private String materialCode;    //  物料编码
    private String materialDesc;  //  物料描述
    private String materialComposition; //  成分
    private String vendorName;  //  供应商
    private String materialImagePath; //  物料图片路径
    /**
     * 辅料定义
     */
    private List<StyleAccessoryDTO> styleAccessoryDTOS;   //  辅料清单
    //  设计点定义，完全按照订单走   TODO    图和AI图
    private String stockInventoryNo;
    private String sampleImagePath; //  实例图片
    private String saleId;  //  价格体系主键，商品定价的唯一标识
    /**
     * 价格信息
     */
    private Double salePrice;   //  零售价

    public SaleStyleSampleDTO(
            String saleInventoryMatialId,
            String saleInventoryId,
            String styleNameCN,
            Integer materialId,
            String materialCode,
            String materialDesc,
            String materialComposition,
            String vendorName,
            String materialImagePath,
            List<StyleAccessoryDTO> styleAccessoryDTOS,
            String stockInventoryNo,
            String sampleImagePath
    ) {
        this.saleInventoryMatialId = saleInventoryMatialId;
        this.saleInventoryId = saleInventoryId;
        this.styleNameCN = styleNameCN;
        this.materialId = materialId;
        this.materialCode = materialCode;
        this.materialDesc = materialDesc;
        this.materialComposition = materialComposition;
        this.vendorName = vendorName;
        this.materialImagePath = materialImagePath;
        this.styleAccessoryDTOS = styleAccessoryDTOS;
        this.stockInventoryNo = stockInventoryNo;
        this.sampleImagePath = sampleImagePath;
    }

    public void build(
            Integer inventorySuffix,
            Integer refInventorySuffix,
            String saleStyleId,
            String saleStyleCode
    ) {
        this.inventorySuffix = inventorySuffix;
        this.refInventorySuffix = refInventorySuffix;
        this.saleStyleId = saleStyleId;
        this.saleStyleCode = saleStyleCode;
    }

    public void build(
            Double salePrice
    ) {
        this.salePrice = salePrice;
    }
}
